<?php
/**
 * [商网通 System] Copyright swtshop.cn
 * QQ: 1170787711
 * Author: gj.name
 * This is NOT a freeware
*/
include '../../UQframework/core/process.php';
include 'pay.class.php';
$browser = cfg('browser');
if ($browser == 'pc') {
    $paycfg = payment_config('alipay', 'pc');
    $paycfg['support'] = 'pc';
} elseif ($browser == 'wap') {
    $paycfg = payment_config('alipay', 'wap');
    $paycfg['support'] = 'wap';
} else {
    exit('不支持此交易');
}
$out_trade_no = isset($_POST['out_trade_no']) ? $_POST['out_trade_no'] : 'fail';
$trade_status = isset($_POST['trade_status']) ? $_POST['trade_status'] : 'fail';
$pcls = new pay_alipay($paycfg);
$result = $pcls->pay_status();
if ($result) {
    if ($_POST['trade_status'] == 'TRADE_FINISHED' || $_POST['trade_status'] == 'TRADE_SUCCESS') {
        $ps = new pay('alipay');
        $row = $ps->pay_run($out_trade_no);
        if ($row['id']) {
        }
    }
}